3.274 \(\int \frac {\tan ^2(x)}{\sqrt {a+a \tan ^2(x)}} \, dx\)

Optimal. Leaf size=31 \[ \frac {\sec (x) \tanh ^{-1}(\sin (x))}{\sqrt {a \sec ^2(x)}}-\frac {\tan (x)}{\sqrt {a \sec ^2(x)}} \]

[Out]

arctanh(sin(x))*sec(x)/(a*sec(x)^2)^(1/2)-tan(x)/(a*sec(x)^2)^(1/2)

________________________________________________________________________________________

Rubi [A]  time = 0.09, antiderivative size = 31, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.294, Rules used = {3657, 4125, 2592, 321, 206} \[ \frac {\sec (x) \tanh ^{-1}(\sin (x))}{\sqrt {a \sec ^2(x)}}-\frac {\tan (x)}{\sqrt {a \sec ^2(x)}} \]

Antiderivative was successfully verified.

[In]

Int[Tan[x]^2/Sqrt[a + a*Tan[x]^2],x]

[Out]

(ArcTanh[Sin[x]]*Sec[x])/Sqrt[a*Sec[x]^2] - Tan[x]/Sqrt[a*Sec[x]^2]

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 321

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[(c^(n - 1)*(c*x)^(m - n + 1)*(a + b*x^n
)^(p + 1))/(b*(m + n*p + 1)), x] - Dist[(a*c^n*(m - n + 1))/(b*(m + n*p + 1)), Int[(c*x)^(m - n)*(a + b*x^n)^p
, x], x] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0] && GtQ[m, n - 1] && NeQ[m + n*p + 1, 0] && IntBinomialQ[a, b,
 c, n, m, p, x]

Rule 2592

Int[((a_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*tan[(e_.) + (f_.)*(x_)]^(n_.), x_Symbol] :> With[{ff = FreeFactors[S
in[e + f*x], x]}, Dist[ff/f, Subst[Int[(ff*x)^(m + n)/(a^2 - ff^2*x^2)^((n + 1)/2), x], x, (a*Sin[e + f*x])/ff
], x]] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n + 1)/2]

Rule 3657

Int[(u_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^2)^(p_), x_Symbol] :> Int[ActivateTrig[u*(a*sec[e + f*x]^2)^p]
, x] /; FreeQ[{a, b, e, f, p}, x] && EqQ[a, b]

Rule 4125

Int[(u_.)*((b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_), x_Symbol] :> With[{ff = FreeFactors[Sec[e + f*x], x]}, Di
st[((b*ff^n)^IntPart[p]*(b*Sec[e + f*x]^n)^FracPart[p])/(Sec[e + f*x]/ff)^(n*FracPart[p]), Int[ActivateTrig[u]
*(Sec[e + f*x]/ff)^(n*p), x], x]] /; FreeQ[{b, e, f, n, p}, x] &&  !IntegerQ[p] && IntegerQ[n] && (EqQ[u, 1] |
| MatchQ[u, ((d_.)*(trig_)[e + f*x])^(m_.) /; FreeQ[{d, m}, x] && MemberQ[{sin, cos, tan, cot, sec, csc}, trig
]])

Rubi steps

\begin {align*} \int \frac {\tan ^2(x)}{\sqrt {a+a \tan ^2(x)}} \, dx &=\int \frac {\tan ^2(x)}{\sqrt {a \sec ^2(x)}} \, dx\\ &=\frac {\sec (x) \int \sin (x) \tan (x) \, dx}{\sqrt {a \sec ^2(x)}}\\ &=\frac {\sec (x) \operatorname {Subst}\left (\int \frac {x^2}{1-x^2} \, dx,x,\sin (x)\right )}{\sqrt {a \sec ^2(x)}}\\ &=-\frac {\tan (x)}{\sqrt {a \sec ^2(x)}}+\frac {\sec (x) \operatorname {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\sin (x)\right )}{\sqrt {a \sec ^2(x)}}\\ &=\frac {\tanh ^{-1}(\sin (x)) \sec (x)}{\sqrt {a \sec ^2(x)}}-\frac {\tan (x)}{\sqrt {a \sec ^2(x)}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.04, size = 49, normalized size = 1.58 \[ -\frac {\sec (x) \left (\sin (x)+\log \left (\cos \left (\frac {x}{2}\right )-\sin \left (\frac {x}{2}\right )\right )-\log \left (\sin \left (\frac {x}{2}\right )+\cos \left (\frac {x}{2}\right )\right )\right )}{\sqrt {a \sec ^2(x)}} \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[x]^2/Sqrt[a + a*Tan[x]^2],x]

[Out]

-((Sec[x]*(Log[Cos[x/2] - Sin[x/2]] - Log[Cos[x/2] + Sin[x/2]] + Sin[x]))/Sqrt[a*Sec[x]^2])

________________________________________________________________________________________

fricas [B]  time = 0.42, size = 64, normalized size = 2.06 \[ \frac {{\left (\tan \relax (x)^{2} + 1\right )} \sqrt {a} \log \left (2 \, a \tan \relax (x)^{2} + 2 \, \sqrt {a \tan \relax (x)^{2} + a} \sqrt {a} \tan \relax (x) + a\right ) - 2 \, \sqrt {a \tan \relax (x)^{2} + a} \tan \relax (x)}{2 \, {\left (a \tan \relax (x)^{2} + a\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(x)^2/(a+a*tan(x)^2)^(1/2),x, algorithm="fricas")

[Out]

1/2*((tan(x)^2 + 1)*sqrt(a)*log(2*a*tan(x)^2 + 2*sqrt(a*tan(x)^2 + a)*sqrt(a)*tan(x) + a) - 2*sqrt(a*tan(x)^2
+ a)*tan(x))/(a*tan(x)^2 + a)

________________________________________________________________________________________

giac [A]  time = 0.39, size = 40, normalized size = 1.29 \[ -\frac {\log \left ({\left | -\sqrt {a} \tan \relax (x) + \sqrt {a \tan \relax (x)^{2} + a} \right |}\right )}{\sqrt {a}} - \frac {\tan \relax (x)}{\sqrt {a \tan \relax (x)^{2} + a}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(x)^2/(a+a*tan(x)^2)^(1/2),x, algorithm="giac")

[Out]

-log(abs(-sqrt(a)*tan(x) + sqrt(a*tan(x)^2 + a)))/sqrt(a) - tan(x)/sqrt(a*tan(x)^2 + a)

________________________________________________________________________________________

maple [A]  time = 0.23, size = 38, normalized size = 1.23 \[ \frac {\ln \left (\sqrt {a}\, \tan \relax (x )+\sqrt {a +a \left (\tan ^{2}\relax (x )\right )}\right )}{\sqrt {a}}-\frac {\tan \relax (x )}{\sqrt {a +a \left (\tan ^{2}\relax (x )\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(x)^2/(a+a*tan(x)^2)^(1/2),x)

[Out]

ln(a^(1/2)*tan(x)+(a+a*tan(x)^2)^(1/2))/a^(1/2)-tan(x)/(a+a*tan(x)^2)^(1/2)

________________________________________________________________________________________

maxima [A]  time = 1.88, size = 42, normalized size = 1.35 \[ \frac {\log \left (\cos \relax (x)^{2} + \sin \relax (x)^{2} + 2 \, \sin \relax (x) + 1\right ) - \log \left (\cos \relax (x)^{2} + \sin \relax (x)^{2} - 2 \, \sin \relax (x) + 1\right ) - 2 \, \sin \relax (x)}{2 \, \sqrt {a}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(x)^2/(a+a*tan(x)^2)^(1/2),x, algorithm="maxima")

[Out]

1/2*(log(cos(x)^2 + sin(x)^2 + 2*sin(x) + 1) - log(cos(x)^2 + sin(x)^2 - 2*sin(x) + 1) - 2*sin(x))/sqrt(a)

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.03 \[ \int \frac {{\mathrm {tan}\relax (x)}^2}{\sqrt {a\,{\mathrm {tan}\relax (x)}^2+a}} \,d x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(x)^2/(a + a*tan(x)^2)^(1/2),x)

[Out]

int(tan(x)^2/(a + a*tan(x)^2)^(1/2), x)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\tan ^{2}{\relax (x )}}{\sqrt {a \left (\tan ^{2}{\relax (x )} + 1\right )}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(x)**2/(a+a*tan(x)**2)**(1/2),x)

[Out]

Integral(tan(x)**2/sqrt(a*(tan(x)**2 + 1)), x)

________________________________________________________________________________________